package cn.bankAutoOffice.controller;

import cn.bankAutoOffice.bean.entity.Employee;
import cn.bankAutoOffice.common.utils.Result;
import cn.bankAutoOffice.service.EmployeeService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * (Employee)表控制层
 *
 * @author makejava
 * @since 2023-04-10 16:26:55
 */
@RestController
@RequestMapping("employee")
public class EmployeeController {
    @Resource
    private EmployeeService employeeService;


    /**
     * 新增员工
     *
     * @param employee 实体
     * @return 新增结果
     */
    @PostMapping("/addEmp")
    public Result add(Employee employee) {
        Integer integer = employeeService.insert(employee);
        if (integer != 0){
            return Result.success("创建成功");
        } else {
            return Result.failure("创建失败");
        }

    }

}

